{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "53e8cfaf",
   "metadata": {},
   "outputs": [],
   "source": [
    "import plotly.express as px\n",
    "from jupyter_dash import JupyterDash\n",
    "import dash_core_components as dcc\n",
    "import dash_html_components as html\n",
    "from dash.dependencies import Input, Output\n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "\n",
    "\n",
    "from sklearn.datasets import make_regression\n",
    "from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier\n",
    "\n",
    "# We add all Plotly and Dash necessary librairies\n",
    "import plotly.graph_objects as go\n",
    "\n",
    "import dash\n",
    "# import dash_daq as daq\n",
    "from dash.dependencies import Input, Output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "9aa9c1e9",
   "metadata": {},
   "outputs": [],
   "source": [
    "X , y = make_regression(n_samples=1000, n_features=4,noise=20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "7a0ea2b8",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(data=X , columns=['X1','X2', 'X3', 'X4'])\n",
    "\n",
    "df['y'] = y "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "caa0241f",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "12fb3362",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression()"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LinearRegression\n",
    "\n",
    "model = LinearRegression()\n",
    "\n",
    "model.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "e8eb188a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x232002104c0>]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD4CAYAAAAEhuazAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAA0oUlEQVR4nO2deXxU5dXHvydhgAGVYEGFAEL7Ila0gsSlYq0iilWQ4Iqtii0t4g6vUkF9FbWWrdVKVSpW64YsKkQQFAVcqajQIDuKgkBCBcEoSoQsz/vHvXMzM7l3lsya5Hw/n3wyz3O3M5PJ7z73POc5R4wxKIqiKI2LnEwboCiKoqQfFX9FUZRGiIq/oihKI0TFX1EUpRGi4q8oitIIaZJpA2KlTZs2pnPnzpk2Q1EUpV6xYsWKr4wxbcP76434d+7cmeXLl2faDEVRlHqFiHzh1q9uH0VRlEaIir+iKEojRMVfURSlEZKw+ItIRxF5U0TWi8haEbnZ7j9URN4QkU/t362DjhkjIptEZKOI9EvUBkVRFCU+kjHyrwRuMcb8FDgFuF5EjgFGA4uNMV2BxXYbe9tgoDtwLvCoiOQmwQ5FURQlRhKO9jHG7AB22K/3ish6IB8YCJxh7/Y08BZwm90/wxizH9gsIpuAk4D3E7VFURQlXoqKS5i0cCOlZeW0z/Mzql83CnvmZ9qslJNUn7+IdAZ6Ah8Ah9s3hsAN4jB7t3xgW9Bh2+0+t/MNE5HlIrJ8165dyTRVURSFouISxsxeTUlZOQYoKStnzOzVFBWXZNq0lJM08ReRg4CXgBHGmG8j7erS55pX2hgz1RhTYIwpaNu21hoFRVGUhJi0cCPlFVUhfeUVVUxauDFDFoUxZw68+GJKTp2URV4i4sMS/mnGmNl295ci0s4Ys0NE2gE77f7tQMegwzsApcmwQ1EUJR5Ky8rj6k8b330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uuohIsYi8LSK/sPsybVM2fVY32C68J4Mehb3sSxeZvn4wBnhdRFaIyDC773BjzA6wxAY4LEO2edmR6c8vK75TItIZ6Al8QAo+qwZZyUtEFgFHuGy6wxjzsr3PHUAlMC1wmMv+JkJ/0m1yYQfQyRizW0R6AUUi0j1ZNiVgV0o/q5ALRbAPmALcZ1/jPuCvWDf0pNsRJ5m+fjC9jTGlInIY8IaIbMiQHfGQyc8vK75TInIQ8BIwwhjzbYSpszrb1SDF3xjTN9J2ERkC9AfOst0TYN0xOwbt1gEotfs7uPQn1SaPY/YD++3XK0TkM+CoZNlUV7tI8WcVTKz2icjjwCtR7EsXmb6+gzGm1P69U0TmYLkEvhSRdsaYHbarbmcmbItgR8Y+P2PMl4HXmfpOiYgPS/inGWNm291J/6wandtHRM4FbgMuMMbsC9o0FxgsIs1EpAvQFfjQfsTaKyKn2JErVwFeI+Jk29pWRHLt1z+2bfo8kzbZZMVnZf8TBBgEBKI2XO1LlR0ufAR0FZEuItIUGGzblFZEpKWIHBx4jRXssMa2ZYi92xDS+90JxsuOjP39Mv2dsv9vngDWG2MeCNqU/M8q2bPV2f6DNSGyDVhp//wjaNsdWLPlGwmKUgEKsL4EnwEPY6+MTqJNg7Du4PuBL4GFdv9FwFqs2fz/AAPSZVMkuzL5WYXZ9yywGlhl/xO0i2ZfGr9n52FFanyG5ULLxHf9x/Z352P7e3SH3f8jYDHwqf370DTYMh3LjVlhf6eGRrIjHX8/D5sy+p0CTsNy26wK0qjzUvFZaXoHRVGURkijc/soiqIoKv6KoiiNEhV/RVGURoiKv6IoSiNExV9RFKURouKvKIrSCFHxVxRFaYT8P2+5MvR1oc8fAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "yp = model.predict(X_test)\n",
    "\n",
    "plt.scatter(yp, y_test)\n",
    "plt.plot(y_test,y_test,color='red')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "c627e443",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([33.22520368, 40.54188087, 36.18859523, 22.79201321]),\n",
       " -0.12597264714278433)"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.coef_ , model.intercept_"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1483f6c9",
   "metadata": {},
   "source": [
    "Final ML Model is : **y = 33.22 X1 + 40.5 X2 + 36.18 X3 + 22.8 X4 -0.126**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "6ed0a96e",
   "metadata": {},
   "outputs": [],
   "source": [
    "fig1 = px.scatter(x=y_test, y=yp)\n",
    "\n",
    "coefdf = pd.DataFrame(data=model.coef_ , index=df.columns[:-1])\n",
    "\n",
    "fig2 = px.bar(coefdf)\n",
    "\n",
    "# fig2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "8f353bc5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dash app running on http://127.0.0.1:8050/\n"
     ]
    }
   ],
   "source": [
    "app = JupyterDash(__name__)\n",
    "\n",
    "app.layout = html.Div(style={'textAlign': 'center', 'width': '1200px', 'font-family': 'Verdana',\n",
    "                            },\n",
    "                      \n",
    "                    children=[\n",
    "\n",
    "                        # Title display\n",
    "                        html.H1(children=\"Machine Learning with DASH\"),\n",
    "                        \n",
    "                        # Dash Graph Component calls the fig_features_importance parameters\n",
    "                        html.Div(style={'textAlign': 'left', 'width': '1200px'},\n",
    "                                 \n",
    "                        children = [html.H4(children=\"Model Predictions vs Actual\"),\n",
    "                                    dcc.Graph(figure=fig1)]),\n",
    "                        \n",
    "                        html.Div(style={'textAlign': 'left', 'width': '1200px'},\n",
    "                                 \n",
    "                        children = [html.H4(children=\"Feature Importance/Weightage\"),\n",
    "                                 dcc.Graph(figure=fig2)]),\n",
    "                        \n",
    "                        \n",
    "                        # We display the most important feature's name\n",
    "                        html.H4(children=df.columns[0]),\n",
    "                        \n",
    "                         dcc.Input(\n",
    "                                        id=\"X1\", type=\"number\",\n",
    "                                        debounce=True, placeholder=\"X1\",\n",
    "                                         value = round(df['X1'].mean(),4)\n",
    "                                    ),\n",
    "                        \n",
    "                        html.H4(children=df.columns[1]),\n",
    "                        \n",
    "                         dcc.Input(\n",
    "                                        id=\"X2\", type=\"number\",\n",
    "                                        debounce=True, placeholder=\"X2\",\n",
    "                                         value = round(df['X2'].mean(),4)\n",
    "                                    ),\n",
    "                        \n",
    "                        html.H4(children=df.columns[2]),\n",
    "                        \n",
    "                         dcc.Input(\n",
    "                                        id=\"X3\", type=\"number\",\n",
    "                                        debounce=True, placeholder=\"X3\",\n",
    "                                        value = round(df['X3'].mean(),4)\n",
    "                                    ),\n",
    "                        \n",
    "                        html.H4(children=df.columns[3]),\n",
    "                        \n",
    "                         dcc.Input(\n",
    "                                        id=\"X4\", type=\"number\",\n",
    "                                        debounce=True, placeholder=\"X4\",\n",
    "                                        value = round(df['X4'].mean(),4)\n",
    "                                    ),\n",
    "        \n",
    "                        \n",
    "                         \n",
    "                        html.H2(id=\"prediction_result\"),\n",
    "\n",
    "\n",
    "                    ])\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "@app.callback(Output(component_id=\"prediction_result\",component_property=\"children\"),\n",
    "\n",
    "# The values correspnding to the three sliders are obtained by calling their id and value property\n",
    "              [Input(\"X1\",\"value\"), Input(\"X2\",\"value\"), Input(\"X3\",\"value\"),Input(\"X4\",\"value\")])\n",
    "\n",
    "# # # The input variable are set in the same order as the callback Inputs\n",
    "def update_prediction(X1, X2, X3,X4):\n",
    "\n",
    "    # We create a NumPy array in the form of the original features\n",
    "    # [\"Pressure\",\"Viscosity\",\"Particles_size\", \"Temperature\",\"Inlet_flow\", \"Rotating_Speed\",\"pH\",\"Color_density\"]\n",
    "    # Except for the X1, X2 and X3, all other non-influencing parameters are set to their mean\n",
    "    input_X = np.array([X1,X2,X3,X4]).reshape(1,-1)        \n",
    "    \n",
    "    # Prediction is calculated based on the input_X array\n",
    "    prediction = model.predict(input_X)[0]\n",
    "    \n",
    "    # And retuned to the Output of the callback function\n",
    "    return \"ML Model Prediction: {}\".format(round(prediction,4))\n",
    "\n",
    "\n",
    "if __name__ == \"__main__\":\n",
    "    app.run_server()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "66bfd4d0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
